package com.neuedu.exception;

import java.io.*;
import java.nio.file.AccessDeniedException;

/**
 * 数学运算
 */
public class MyMath {

    public static int sum(int numa , int numb){
        if(numa >=100  || numb >= 100) {
            throw new BusinessException("数学运算范围不对....");
        }

        return  numa + numb;
    }

    /**
     * 处理异常的第一种 ：  抛异常
     * @param path
     */
    public static void method1(String path) throws  IOException ,FileNotFoundException {
        File file = new File(path);
        InputStream io = new FileInputStream(file);
        io.close();
        System.out.println("读取完成");
    }
}
